package com.siyao.redvip.ui.loadpage;

import java.util.ArrayList;
import java.util.List;

import com.siyao.redvip.R;
import com.siyao.redvip.ui.fragment.LoadPageFragment1;
import com.siyao.redvip.ui.fragment.LoadPageFragment2;
import com.siyao.redvip.ui.fragment.LoadPageFragment3;
import com.siyao.redvip.ui.fragment.LoadPageFragment4;
import com.siyao.redvip.utils.SharedPreferencesUtils;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;

/**
 * ViewPager功能介绍页
 * @author lenovo
 *
 */
public class LoadPageActivity extends FragmentActivity{
	
	private ViewPager mVPActivity;
	private List<Fragment> mListFragment = new ArrayList<Fragment>();
	private PagerAdapter mPgAdapter;
	
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		this.requestWindowFeature(getWindow().FEATURE_NO_TITLE);
		setContentView(R.layout.activity_load_page);
		SharedPreferencesUtils.setFrist(this,false);
		ininlazeView();
	}
	
	public void ininlazeView(){
		mVPActivity = (ViewPager) findViewById(R.id.vp_all);
		mListFragment.add(LoadPageFragment1.getInstance());
		mListFragment.add(LoadPageFragment2.getInstance());
		mListFragment.add(LoadPageFragment3.getInstance());
		mListFragment.add(LoadPageFragment4.getInstance());
		mPgAdapter= new ViewPagerAdapter(getSupportFragmentManager(), mListFragment);
		mVPActivity.setAdapter(mPgAdapter);
	}
}
